home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games: Greatest Hits 1996
/
Amiga Games: Greatest Hits 1996.iso
/
archive
/
userbox
/
publicdomain
/
fractal.lha
/
fractal
/
README.AMIGA
< prev
next >
Wrap
Text File
|
1996-07-02
|
10KB
|
260 lines
FRACTAL package
Amiga Port V1.0 (enc/dec V0.03/0.05)
Copyright 1993,1994 Yuval Fisher. All rights reserved.
Amiga port done in 1996 by Andreas R. Kleinert
(For the complete sources by Y. Fisher please refer to
http://inls.ucsd.edu/y/home.html where you may branch to
http://inls.ucsd.edu/y/fractals/ and obtain the possible rest from)
Sources changed for and compiled with SAS/C V6.56 with
settings for 68030/68881.
Port release date: 02. July 1996
COPYRIGHT AND AUTHOR
--------------------
The basic routines for encoding a byte image using a fractal scheme
with a quadtree partition and decoding an image encoded with a quadtree
partition based fractal scheme have been developed by
Yuval Fisher (yfisher@ucsd.edu), who also wrote two small programs
for handling that.
The work as described in the following is based on the files
enc.c (Version 0.03 3/14/94) and dec.c (Version 0.05 10/10/94),
which are both Copyright 1993,1994 Yuval Fisher. All rights reserved.
The original copyright notice can be found in the file COPYING
- this file you are reading right NOW only contains additional
information, refering to the Amiga port.
DISCLAIMER
----------
Before you do anything else, read the DISCLAIMER for the work
and changes I did on the Amiga port of this tool:
THERE IS NO WARRANTY FOR THE PROGRAMS.
THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAMS
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
AND PERFORMANCE OF THE PROGRAMS IS WITH YOU.
SHOULD THE PROGRAMS PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
SERVICING, REPAIR OR CORRECTION.
IN NO EVENT UNLESS WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
REDISTRIBUTE THE PROGRAMS AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAMS (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAMS TO OPERATE WITH ANY
OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
THE POSSIBILITY OF SUCH DAMAGES.
Well, and have a nice day :-)
AMIGA PORT
----------
Well, at first I decided to port the two programs "yuvpak.c" and "yuvpak.c",
which I found in the path "UTIL/YUV20" on the Franzis Verlag's
"Grafik Tools" CD/ROM.
These two tools dealt with applying an YUV transformation to 24 Bit
data read from a 256x256 Targa file, did some fractal compression on
it and then wrote the proprietary IFS file format out of it.
Unfortunately these tools were limited to a size of 256x256 and
due to some major "features" in the file header (using GCC bitfields
and possibly int*l byte order) I never got it working right on the Amiga
with SAS/C V6.56, while the DOS pendants worked quite nice.
Amiga compilates were extremely slow, used too much stack size and
produced bad output. That was mostly caused by the DOS-specific
and unoptimized C-Sourcecode used in yuvpack.c, yuvunpack.c and wdyusual.c
I decided to follow the URL links given and looked for possible newer
version of these two tools - what I found, were two other tools:
env.c and dec.c do not accept 24 Bit TGA files, but 8 Bit gray RAW
instead, but are actually much more better optimized and quite fast
on 256x256 pictures with default settings (some minutes for encoding,
a few seconds for decoding).
Also, all sizes (width/height must be divideable by 8) now are supported.
To get a practical use out of these tools, perhaps much, much work
still has to be done.
Since Y. Fisher's distribution restrictions do not allow any
"closed shop development" but require it to be freely distributable
and modifyable for all other people, I decided to release this
Amiga port as a package, which anyone may take a look at and make
suggestions to.
I have a rough idea of making an IFF file format and datatype out of
it and need people making speed improvements on the algorithms and
suggestions for the file format (see SUGGESTIONS section).
Of course, the result should be free again, respecting the license given
by Y. Fisher (see file COPYING).
USAGE
-----
Well, please read the file "USAGE" for any missing information
in here - it's the original one from Y. Fisher.
Set the stacksize for your CLI/Shell to a HIGH value !
The Tools: o enc [options] infile.RAW outfile.FRC
You need 8 Bit gray RAW input, which most
simply can be generated by cutting of the
header from PGM (P5) file (can be created
with tools from the PBM package and then
edited with a hex or capable text editor).
SuperView's PNM.svobject also allows
to generate RAW files as with PNM V3.4.
o dec [options] infile.FRC outfile.RAW
8 Bit gray RAW output, will be generated,
which most simply again can be turned into
a PGM (P5) file by adding the necessary
information header with a hex or capable
text editor - again ;-)
As you can see, the creation of a fractal-compressed 24 Bit file
would require splitting it into three single files for each
of the red, green and blue components and then compressing these
as single files - just as if these were "gray".
This is the point, were improvements have to take place
(see SUGGESTIONS section).
INCONVENIENCE ABOUT POSSIBLE INCOMPLETENESS
-------------------------------------------
Sorry for any possible missing parts of the distribution, but
my FTP access to Y. Fishers site was _very_ bad, so that I only
could download some of the single text files laying there and not the
full 73K tar.gz archive.
For the complete sources by Y. Fisher please refer to
http://inls.ucsd.edu/y/home.html where you may branch to
http://inls.ucsd.edu/y/fractals/ and obtain the possible rest from.
CHANGES
-------
See file CHANGES.AMIGA (and the sources enc.c and dec.c) for which
changes had to be made to the original sources (included in the
directory "source_original").
SUGGESTIONS
-----------
Since the only popular fractal image file format FIF is
- different from e.g. JFIF's JPEG file format - protected
by patent claims and large license fees, the work of
Y. Fisher could be seen as an alternative way to make
a free fractal image file format possible.
If some improvements on compression speed (by keeping compatibility)
could be made, this file format may have a decent chance (remember,
how slow JPEG was in the beginning).
Decoding already is quite fast, compared with enconding.
To not complicate things, the resulting file format should be
of type IFF and not change anything of the original, basic design.
It should just store the resulting three .FRC files, which
were created after splitting a 24 Bit source into their components,
and some additional information from the common file header
(image size and compression ratio).
8 Bit Gray type files also should be supported.
IFF specification
-----------------
The file format should be called IFF-FRIC
(Fractal Image Container File Format)
^^ ^ ^
Consider the following IFF specification:
/* ------------------------------------------------------ */
#include <exec/types.h>
#include <libraries/iffparse.h>
#define ID_FRIC MAKE_ID('F','R','I','C') /* the FORM type */
#define ID_F_RD MAKE_ID('F','_','R','D')
#define ID_F_GR MAKE_ID('F','_','G','R')
#define ID_F_BL MAKE_ID('F','_','B','L')
#define ID_F_EY MAKE_ID('F','_','E','Y')
struct FRHD_Chunk /* FRIC Header */
{
ULONG width; /* must be divideable by 8 */
ULONG height; /* must be divideable by 8 */
ULONG depth; /* either 8 or 24 */
ULONG m_flag; /* compression, see enc.c */
ULONG t_flag; /* compression, see enc.c */
};
/* ------------------------------------------------------ */
A typical FRIC file should be structured as follows, where
all typical IFF graphics chunks, like CAMG, AUTH, ANNO, etc.
as well can and should be present:
1. Grayscaled graphics)
FORM-FRIC
FRHD
-----------------------
the FRHD header data
-----------------------
CAMG
-----------------------
Amiga 32 Bit CAMG chunk
-----------------------
F_EY
-----------------------
8 Bit gray image data
(complete FRC file content)
-----------------------
2. 24 Bit graphics
FORM-FRIC
FRHD
-----------------------
the FRHD header data
-----------------------
CAMG
-----------------------
Amiga 32 Bit CAMG chunk
-----------------------
F_RD
-----------------------
8 Bit RED component
(complete FRC file content)
-----------------------
F_GR
-----------------------
8 Bit GREEN component
(complete FRC file content)
-----------------------
F_BL
-----------------------
8 Bit BLUE component
(complete FRC file content)
-----------------------